﻿//-----------------------------------------------------------------------
// <copyright file="CustomerSearch.cs" company="ET">
//     Copyright Mulala. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Mulala.Cavan.Domain.Seedwork
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Mulala.Cavan.Core.Persistent;

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TID">The type of the ID.</typeparam>
    public class BaseSearch<TID> : ISearch<TID> 
    {
        #region ISearch Members

        /// <summary>
        /// DO NOT FILL !!!
        /// Dao will fill this value.
        /// Total count of all rows matching searching criteria.
        /// DO NOT USE !!!
        /// </summary>
        /// <value>The total row count.</value>
        public long TotalRowCount
        {
            get;
            set;
        }

        /// <summary>
        /// SET Maximum rows count on a page.
        /// In fact this value is always set, by default to 20.
        /// In cases when the target is to find any - set it to 1.
        /// When you want all records, set it to int.MaxValue
        /// </summary>
        /// <value>The max rows per page.</value>
        public int MaxRowsPerPage
        {
            get;
            set;
        }

        /// <summary>
        /// Paging. This value is maintained by base controller
        /// and keeps information about which is the currently navigated page
        /// </summary>
        /// <value>The current page.</value>
        public int CurrentPage
        {
            get;
            set;
        }

        /// <summary>
        /// Keeps the current Item number (position in the list)
        /// to allow paging base on single Item!
        /// </summary>
        /// <value>The current row.</value>
        public int CurrentRow
        {
            get;
            set;
        }

        /// <summary>
        /// The counted value! Allows to display on UI how many pages is in the storage
        /// </summary>
        /// <value>The page count.</value>
        public long PageCount
        {
            get;
            set;
        }

        /// <summary>
        /// order by dictionary
        /// </summary>
        public IDictionary<string, bool> OrderBy
        {
            get;
            set;
        }

        #endregion

        #region ISearch<TID> Members

        /// <summary>
        /// Gets or sets the ID.
        /// </summary>
        /// <value>The ID.</value>
        public TID ID
        {
            get;
            set;
        }

        #endregion
    }
}
